#ifndef TESTPICSHOWWIDGET_H
#define TESTPICSHOWWIDGET_H

#include <QWidget>
#include <opencv2/core/mat.hpp>

#include <QTimer>
#include <chrono>
#include <qlabel.h>

#include "opencv2/opencv.hpp"

namespace Ui {
class TestPicShowWidget;
}

class TestPicShowWidget : public QWidget {
  Q_OBJECT

  public:
  explicit TestPicShowWidget(QWidget *parent = nullptr);
  ~TestPicShowWidget();

  void show_pic(int num, const cv::Mat &mat);

  private:
  void _check_active();

  static void _set_label_active(QLabel* label, bool active);

  private:
  Ui::TestPicShowWidget *ui;

  int cnt_1_{0};
  std::chrono::high_resolution_clock::time_point last_time_1_;

  int cnt_2_{0};
  std::chrono::high_resolution_clock::time_point last_time_2_;

  QTimer *timer_{nullptr};
};

#endif // TESTPICSHOWWIDGET_H
